package com.demo.exception;

public class MyExceptionHandler{}
//@Component
//public class MyExceptionHandler implements HandlerExceptionResolver {
//
//    @Override
//    public ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
//        Map<String, Object> model = new HashMap<>();
//        //根据不同错误转向不同页面，也就是异常和View的对应关系
//        if (ex instanceof MyException) {
//            return new ModelAndView("my-error", model);
//        } else if (ex instanceof SQLException) {
//            return new ModelAndView("sql-error", model);
//        }
//        return new ModelAndView("error", model);
//    }
//}
